From 13c1dea65943be7d2a0104e43ca7fead03ee25f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Mon, 15 Jan 2018 22:41:03 +0100 Subject: [PATCH] babl: use memcpy dpsatch path for all identity transforms --- babl/babl-fish-path.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 19d7f14..8b614e8 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -668,19 +668,18 @@ babl_fish_memcpy_process (const Babl *babl, void _babl_fish_rig_dispatch (Babl *babl) { + babl->fish.data = (void*)&(babl->fish.data); + + if (babl->fish.source == babl->fish.destination) + { + babl->fish.dispatch = babl_fish_memcpy_process; + return; + } + switch (babl->class_type) { case BABL_FISH_REFERENCE: - if (babl->fish.source == babl->fish.destination) - { - babl->fish.dispatch = babl_fish_memcpy_process; - babl->fish.data = (void*)&(babl->fish.data); - } - else - { - babl->fish.dispatch = babl_fish_reference_process; - babl->fish.data = (void*)&(babl->fish.data); - } + babl->fish.dispatch = babl_fish_reference_process; break; case BABL_FISH_SIMPLE: @@ -706,12 +705,10 @@ _babl_fish_rig_dispatch (Babl *babl) /* do same short-circuit optimization as for simple fishes */ babl->fish.dispatch = conversion->dispatch; - babl->fish.data = &conversion->data; } else { babl->fish.dispatch = babl_fish_path_process; - babl->fish.data = (void*)&(babl->fish.data); } break; -- 2.30.2